home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / asmwiz10.arc / ASMWIZ.DOC next >
Text File  |  1990-04-06  |  26KB  |  626 lines

  1.                          The Assembly Wizard's Library
  2.  
  3.                ASMWIZ  Copyright (c) 1990  Thomas G. Hanlin III
  4.  
  5.  
  6.  
  7. This is ASMWIZ, a library of assembly language routines for assembly language
  8. programmers.  It is copyrighted and may be distributed only under the
  9. following conditions:
  10.  
  11.    1) No fee of over $5.00 may be charged for distribution.  This restriction
  12.       applies only to physical copies and is not meant to prevent
  13.       distribution by telecommunication.
  14.  
  15.    2) All ASMWIZ files must be distributed together in original, unaltered
  16.       form.  This includes ASMWIZ.DOC, ASMWIZ.MAN, ASMWIZ.NEW, ASMWIZ.XRF,
  17.       CREATE.BAT, EXAMPLE.ASM, EXAMPLE.COM, FILES.LST, and REGISTER.TXT.
  18.  
  19. You use this library at your own risk.  It has been tested by me on my own
  20. computer, but I will not assume any responsibility for any problems which
  21. ASMWIZ may cause you.  If you do encounter a problem, please let me know
  22. about it, and I will do my best to verify and repair the error.
  23.  
  24. It is expected that if you find ASMWIZ useful, you will register your copy.
  25. This entitles you to receive the latest version of ASMWIZ on a 5 1/4" disk,
  26. complete with full source code.  The source code is designed for the OPTASM
  27. assembler by SLR Systems and may require minor modifications to assemble
  28. under MASM or TASM.  See REGISTER.TXT for more information.
  29.  
  30.      *** Limited-time Offer ***
  31. Those who register ASMWIZ before May 1, 1990, will receive a free upgrade to
  32. the next version of ASMWIZ.
  33.  
  34. The ASMWIZ library was designed for use with small assembly programs and is
  35. compatible with the creation of COM files.  All CALLs are of the NEAR
  36. variety.  If there is sufficient interest, a FAR model will also be made.
  37.  
  38. For an example of how to set up your program to access the ASMWIZ library,
  39. how to LINK the routines, and so forth, see the EXAMPLE.ASM, EXAMPLE.COM,
  40. and CREATE.BAT files.
  41.  
  42. Note that DOS-dependent services expect DOS 2.0 or higher versions, unless
  43. otherwise specified.
  44.  
  45. Services to be added in future versions include screen save/restore, support
  46. for Hercules/CGA/EGA/VGA graphics, additional mouse handling, keyboard
  47. control and input services, flexible file handling with automatic network
  48. support and buffering, expanded and extended memory support, background
  49. music, ANSI emulation, communications, and much more.  If there is something
  50. in particular that you'd like to see, please let me know about it.
  51.  
  52.                            Base Conversion Services
  53.  
  54.  
  55.  
  56. The Base Conversion Services provide the ability to convert back and forth
  57. between a number and its ASCIIZ representation.  Any base from 2-36 may be
  58. employed, so these routines encompass binary, decimal, hex and octal
  59. conversions.  Services are provided for integers and long integers, both
  60. signed and unsigned.
  61.  
  62.  
  63. The following services are available:
  64.  
  65.    BC_ASC2INT    convert an ASCIIZ string to an unsigned integer
  66.                        BL <-- base from which to convert
  67.                     DS:SI <-- ptr to string
  68.                     -------
  69.                        AX = unsigned integer
  70.  
  71.    BC_ASC2LONG   convert an ASCIIZ string to an unsigned long integer
  72.                        BL <-- base from which to convert
  73.                     DS:SI <-- ptr to string
  74.                     -------
  75.                     DX,AX = unsigned long integer
  76.  
  77.    BC_ASC2SINT   convert an ASCIIZ string to a signed integer
  78.                        BL <-- base from which to convert
  79.                     DS:SI <-- ptr to string
  80.                     -------
  81.                        AX = signed integer
  82.  
  83.    BC_ASC2SLONG  convert an ASCIIZ string to a signed long integer
  84.                        BL <-- base from which to convert
  85.                     DS:SI <-- ptr to string
  86.                     -------
  87.                     DX,AX = signed long integer
  88.  
  89.    BC_INT2ASC    convert an unsigned integer to an ASCIIZ string
  90.                        AX <-- unsigned integer
  91.                        BL <-- base to which to convert
  92.                     ES:DI <-- ptr to string buffer (recommend 17 bytes)
  93.  
  94.    BC_LONG2ASC   convert an unsigned long integer to an ASCIIZ string
  95.                     DX,AX <-- unsigned long integer
  96.                        BL <-- base to which to convert
  97.                     ES:DI <-- ptr to string buffer (recommend 33 bytes)
  98.  
  99.    BC_SINT2ASC   convert a signed integer to an ASCIIZ string
  100.                        AX <-- signed integer
  101.                        BL <-- base to which to convert
  102.                     ES:DI <-- ptr to string buffer (recommend 18 bytes)
  103.  
  104.    BC_SLONG2ASC  convert a signed long integer to an ASCIIZ string
  105.                     DX,AX <-- signed long integer
  106.                        BL <-- base to which to convert
  107.                     ES:DI <-- ptr to string buffer (recommend 34 bytes)
  108.  
  109.                                 Delay Services
  110.  
  111.  
  112.  
  113. The Delay Services are for those times when you want the computer to sit
  114. around doing nothing for a while.  Delays of various timing resolution are
  115. available for anything from small to large waits.
  116.  
  117. Note that timers 0-1 may be used by ASMWIZ itself.  See ASMWIZ.MAN for more
  118. details on the 100th-second delay services.
  119.  
  120.  
  121. The following services are available:
  122.  
  123.  
  124.    MD_DELAY      delay for a number of 100ths of seconds
  125.                        CX <-- delay (0-32767)
  126.  
  127.    MD_DONE       terminate 100th-second delay handler
  128.  
  129.    MD_GETTIMER   get a delay count
  130.                        AL <-- timer number (0-3)
  131.                     -------
  132.                        CX = delay * 2 (0-65534)
  133.  
  134.    MD_INIT       initialize 100th-second delay handler
  135.  
  136.    MD_SETTIMER   set a delay count
  137.                        AL <-- timer number (0-3)
  138.                        CX <-- delay (0-32767)
  139.  
  140.    MD_TICK       delay for a number of clock ticks (18ths of seconds)
  141.                        CX <-- delay (0-65535)
  142.  
  143.                             Math (32-bit) Services
  144.  
  145.  
  146.  
  147. The Math Services provide support for the basic arithmetic operations on
  148. unsigned long integers.  They allow you to add two 32-bit integers, subtract
  149. one 32-bit integer from another, multiply two 32-bit integers (giving a
  150. 64-bit result), and divide a 63-bit integer by a 32-bit integer (giving a
  151. 32-bit result and 32-bit remainder).
  152.  
  153. Since 32-bit integers are rather unwieldy unless you're using an 80386 or
  154. above (in which case you don't need these services anyway), the numbers are
  155. passed back and forth through a buffer in memory.
  156.  
  157.  
  158. The following services are available:
  159.  
  160.    MA_ADD32      add two unsigned long integers
  161.                     DS:SI   <-- first operand
  162.                     DS:SI+4 <-- second operand
  163.                     -------
  164.                     DS:SI+8 = result
  165.  
  166.    MA_DIV32      divide an unsigned 63-bit integer by an unsigned long integer
  167.                     DS:SI   <-- dividend (64 bits: high bit must be zero)
  168.                     DS:SI+8 <-- divisor (unsigned long integer)
  169.                     -------
  170.                     DS:SI+12 = quotient (unsigned long integer)
  171.                     DS:SI+16 = remainder (unsigned long integer)
  172.  
  173.    MA_MUL32      multiply two unsigned long integers
  174.                     DS:SI   <-- first operand
  175.                     DS:SI+4 <-- second operand
  176.                     -------
  177.                     DS:SI+8 = result (unsigned very long integer: 64 bits)
  178.  
  179.    MA_SUB32      subtract one unsigned long integer from another
  180.                     DS:SI   <-- first operand
  181.                     DS:SI+4 <-- second operand
  182.                     -------
  183.                     DS:SI+8 = result
  184.  
  185.                                 Memory Services
  186.  
  187.  
  188.  
  189. The Memory Services provide low-level routines for memory manipulation.  They
  190. allow you to manipulate addresses, as well as providing a "smart" block move
  191. service that automatically handles overlaps between source and destination
  192. areas.
  193.  
  194. Among the address manipulation services are routines to convert an address to
  195. have the smallest possible segment and highest possible offset (or vice
  196. versa) to allow REP operations to always handle up to 65,519 bytes without
  197. wrapping within the segment.
  198.  
  199.  
  200. The following services are available:
  201.  
  202.    ME_HIGHOFS    convert an address to have the lowest segment & highest offset
  203.                     DX:AX <-- segment:offset
  204.                     -------
  205.                     DX:AX = converted segment:offset
  206.  
  207.    ME_LOWOFS     convert an address to have the highest segment & lowest offset
  208.                     DX:AX <-- segment:offset
  209.                     -------
  210.                     DX:AX = converted segment:offset
  211.  
  212.    ME_MOVE       move a block of memory without overlap conflicts
  213.                     DS:SI <-- source segment:offset
  214.                     ES:DI <-- destination segment:offset
  215.                        CX <-- bytes to move (0 - 65,519)
  216.  
  217.                             Miscellaneous Services
  218.  
  219.  
  220.  
  221. The Miscellaneous Services provide a number of services for various purposes,
  222. such as parsing the command line, scanning the environment for a
  223. parameter, and generating pseudo-random numbers.  They eliminate much of the
  224. tedium of these common chores.
  225.  
  226.  
  227. The following services are available:
  228.  
  229.    MI_BOOT       reboot the computer (warm boot)
  230.  
  231.    MI_MATCHFILE  see if a filename matches a specified pattern
  232.                     DS:SI <-- pattern (may contain wildcards)
  233.                     ES:DI <-- filename (may not contain drive or path specs)
  234.                     -------
  235.                     flags = ZF if the filename matches the pattern
  236.                             NZ if the filename doesn't match the pattern
  237.  
  238.    MI_PARSE      parse a command line into filespecs and options
  239.                     DS:SI <-- ptr to command line (for COM files, is CS:0080h)
  240.                     ES:DI <-- ptr to filename buffer (recommend 128 bytes)
  241.                     ES:BX <-- ptr to option buffer (recommend 128 bytes)
  242.                        AL <-- switch character (normally "/" for MS-DOS)
  243.                     -------
  244.                        AH = number of options
  245.                        AL = number of filenames
  246.  
  247.    MI_RANDOM     generate a pseudo-random number
  248.                        DX <-- random number range (1-4000)
  249.                     -------
  250.                        AX = random number (0 to DX - 1)
  251.  
  252.    MI_RANDOMIZE  initialize the pseudo-random number generator
  253.                        AX <-- random number seed (use 0FFFFh for auto-seeding)
  254.  
  255.    MI_SCANENV    scan the DOS environment for a parameter
  256.                     DS:SI <-- ptr to the DOS environment or similar table
  257.                     ES:DI <-- ptr to the parm for which to search
  258.                     -------
  259.                        CY if not found
  260.                        NC if match found; DS:SI points to parm value
  261.  
  262.                                 Mouse Services
  263.  
  264.  
  265.  
  266. The Mouse Services provide a simple set of functions for dealing with
  267. Microsoft-compatible mouse devices.  You may see if a mouse exists, control
  268. the mouse cursor, and get information about the mouse buttons.
  269.  
  270.  
  271. The following services are available:
  272.  
  273.    MO_HIDECURSOR hide the mouse cursor
  274.  
  275.    MO_INIT       see if a mouse is installed (and if so, how many buttons)
  276.                     -------
  277.                        AL = number of buttons on the mouse (zero if no mouse)
  278.  
  279.    MO_LOCATE     set the mouse cursor location
  280.                        DH <-- row (1-25)
  281.                        DL <-- column (1-80)
  282.  
  283.    MO_RANGE      set the mouse cursor range
  284.                        CH <-- top row (1-25)
  285.                        CL <-- leftmost column (1-80)
  286.                        DH <-- bottom row (1-25)
  287.                        DL <-- rightmost column (1-80)
  288.  
  289.    MO_SHOWCURSOR show the mouse cursor
  290.  
  291.    MO_WHERE      get the mouse cursor location and button states
  292.                     -------
  293.                        AL = left button (0 = not pressed, 1 = pressed)
  294.                        AH = right button (0 = not pressed, 1 = pressed)
  295.                        DH = row (1-25)
  296.                        DL = column (1-80)
  297.  
  298.  
  299.                            Sound and Music Services
  300.  
  301.  
  302.  
  303. The Sound and Music Services provide the ability to generate sound effects
  304. and music.  The current service is rather on the primitive side.  It will be
  305. supplemented by a background (interrupt-driven) music command language in a
  306. future version of ASMWIZ.
  307.  
  308.  
  309. The following services are available:
  310.  
  311.    MU_SOUND      produce a sound of a specified duration and frequency
  312.                     AX <-- frequency (Hertz; about 50-4000 is useful)
  313.                     DX <-- duration  (18ths of seconds)
  314.  
  315.                               Video Text Services
  316.  
  317.  
  318.  
  319. Displaying text is something that almost every program will do.  The ASMWIZ
  320. library contains numerous sets of video services which make it easy to use
  321. the display in a consistent manner.
  322.  
  323. The display services are divided into four sets of routines, each of which
  324. provides similar capabilities:
  325.  
  326.    DOS-level services
  327.    BIOS-level services
  328.    Machine-level services for text modes
  329.    Machine-level services for CGA graphics modes
  330.  
  331. The DOS services provide the maximum level of compatibility.  They are also
  332. the slowest of the video services and the least flexible.  The main practical
  333. advantage of using DOS services is that they allow redirection, so the output
  334. of your program can be sent to a file, a printer, or a serial port as well as
  335. to the display.  Since DOS itself has only minimal video support, you will
  336. need to make sure an ANSI driver is installed before using these services.
  337. See your DOS manual on ANSI.SYS for more information if you need it.
  338.  
  339. The BIOS services provide a very good level of compatibility.  They are
  340. faster and more flexible than the DOS services.  Like the DOS services, these
  341. routines are quite likely to work on nonstandard displays.
  342.  
  343. The machine-level services are the least compatible.  They will work on any
  344. standard PC clone, but not on semi-compatible hardware or with nonstandard
  345. display devices.  In return for this disadvantage, these services are much
  346. faster than the other services and provide a great deal more flexibility.
  347.  
  348.                               Text Display Speeds
  349.  
  350.  
  351.  
  352. Speed tests were conducted on an 8088 machine with a Phoenix BIOS, running
  353. MS-DOS 3.30.  Ratings may vary on other machines and DOS versions.  The tests
  354. were conducted on how quickly strings could be printed to the display.
  355.  
  356. Speeds are listed relative to the slowest display method (DOS services).
  357.  
  358.  
  359.  
  360.                            +-----------+-----------+-----------+
  361.                            | DV_STROUT | BV_STROUT | MV_STROUT |
  362.               +------------+-----------+-----------+-----------+
  363.               | Mode 3     |           |           |           |
  364.               | text mode  |   100%    |   162%    |   572%    |
  365.               +------------+-----------+-----------+-----------+
  366.               | Mode 4     |           |           |           |
  367.               | CGA lo-res |   100%    |   114%    |   180%    |
  368.               +------------+-----------+-----------+-----------+
  369.               | Mode 6     |           |           |           |
  370.               | CGA hi-res |   100%    |   122%    |   204%    |
  371.               +------------+-----------+-----------+-----------+
  372.  
  373.  
  374.  
  375. From this chart, you can see that using BIOS display services is 14% - 62%
  376. faster than using DOS services.  Using machine-level services is 80% - 472%
  377. faster than using DOS services, and about 60% - 250% faster than using BIOS
  378. services.
  379.  
  380. If system compatibility is a major concern, then note that the DOS services
  381. are most compatible, followed by the BIOS services and then the machine-level
  382. services.  The price you pay for compatibility is speed and flexibility.  The
  383. machine-level services are the fastest and most flexible, followed by the
  384. BIOS services and then the DOS services.
  385.  
  386.                           General Video Information
  387.  
  388.  
  389.  
  390. For all text routines, color/attributes are encoded as a single byte value:
  391.  
  392. bit:    7   6   5   4   3   2   1   0
  393.       +---+---+---+---+---+---+---+---+
  394.       | B |  backgnd  | I |  foregnd  |
  395.       +---+---+---+---+---+---+---+---+
  396.  
  397. B:  "blink".  Set if the color is blinking.
  398.  
  399. I:  "intense".  Set if the foreground color is intense (bright or light).
  400.  
  401. backgnd, foregnd:  the actual foreground and background colors.  The bits
  402.     specify the red, green, and blue components of the color, giving the
  403.     following list of colors:
  404.  
  405.        0    black     (if intense, may or may not be displayed as gray)
  406.        1    blue
  407.        2    green
  408.        3    cyan
  409.        4    red
  410.        5    magenta
  411.        6    brown     (if intense, is usually displayed as yellow)
  412.        7    white
  413.  
  414.  
  415. Text in CGA graphics modes is different.  If you use BIOS or DOS services,
  416. you may only specify a foreground color, which may be 0-3.  If you use the
  417. CGA machine-level services, you may specify a background color as well as a
  418. foreground color.  Color encoding is the same as for text mode, with the
  419. exception that there are no "blinking" or "intense" bits, and the color range
  420. is 0-3 instead of 0-7.  The 0-3 range does not follow the above color list;
  421. the colors depend instead on which CGA palette is in use.
  422.  
  423.  
  424.  
  425. Screen modes are specified as a single byte, as follows:
  426.  
  427.      Mode  Resolu.  Type  Colr  Use        Adapter(s)        Services
  428.  
  429.        0   40x25    b&w     16  text       CGA, EGA, VGA     MV, BV, DV
  430.        1   40x25    color   16  text       CGA, EGA, VGA     MV, BV, DV
  431.        2   80x25    b&w     16  text       CGA, EGA, VGA     MV, BV, DV
  432.  def-  3   80x25    color   16  text       CGA, EGA, VGA     MV, BV, DV
  433.        4   320x200  color    4  graphics   CGA, EGA, VGA     CG, BV, DV
  434.        5   320x200  b&w      4  graphics   CGA, EGA, VGA     CG, BV, DV
  435.        6   640x200  color    2  graphics   CGA, EGA, VGA     CG, BV, DV
  436.  mda-  7   80x25    b&w      -  text       MDA, EGA, VGA     BV
  437.       13   320x200  color   16  graphics   EGA, VGA          BV
  438.       14   640x200  color   16  graphics   EGA, VGA          BV
  439.       15   640x350  mono     -  graphics   EGA, VGA          BV
  440.       16   640x350  color   16  graphics   EGA, VGA          BV
  441.       17   640x480  color    2  graphics   VGA               BV
  442.       18   640x480  color   16  graphics   VGA               BV
  443.       19   320x200  color  256  graphics   VGA               BV
  444.  
  445. BV = BIOS video services             DV = DOS video services
  446. MV = Machine-level text services     CG = Machine-level CGA graphics services
  447.  
  448.                               Video Service List
  449.  
  450.  
  451.  
  452. All of the video services share a common nomenclature and calling procedure.
  453. For many of the services, you will have a choice of whether to use DOS, BIOS,
  454. Machine-level (text modes), or Machine-level (CGA graphics modes).  The level
  455. is specified as a two-letter code prefix to the routine name, where the codes
  456. are as follows:
  457.  
  458.     DV    DOS Video
  459.     BV    BIOS Video
  460.     MV    Machine-level (text mode) Video
  461.     CG    Machine-level (CGA graphics mode) Video
  462.  
  463. The routine to display a string using DOS services, for example, is named
  464. DV_STROUT (DOS Video service, String Output).  It usually isn't a good idea
  465. to "mix and match" video services of different types.
  466.  
  467.  
  468. The following services are available:
  469.  
  470.  
  471.     CHROUT      display a character                               BV,DV,MV,CG
  472.                    AL <-- character
  473.  
  474.     CLS         clear the screen and home the cursor              BV,DV,MV,CG
  475.  
  476.     COLOR       set the text color                                BV,DV,MV,CG
  477.                    AL <-- color/attribute
  478.  
  479.     CRLF        display a carriage return and a linefeed          BV,DV,MV,CG
  480.  
  481.     CLEOLN      clear from the cursor to the end of the line      BV,DV,MV,CG
  482.  
  483.     DELCHR      delete the character at the cursor                  ,  ,MV,
  484.  
  485.     DELLINE     delete the current line                           BV,dv,MV,
  486.  
  487.     GETCOLOR    get the text color                                BV,  ,MV,CG
  488.                    AL = color/attribute
  489.  
  490.     HIDECURSOR  hide the cursor                                   BV,  ,MV,
  491.  
  492.     INIT        initialize the video service routines                   MV,CG
  493.  
  494.     INSCHR      insert a space at the cursor                        ,  ,MV,
  495.  
  496.     INSLINE     insert a row at the current line                  BV,dv,MV,
  497.  
  498.     LOCATE      set the cursor position                           BV,DV,MV,CG
  499.                    DH <-- row (1-25), DL <-- column (1-40/80)
  500.  
  501.     MODE        set the screen mode                               BV,DV,MV,CG
  502.                    AL <-- mode (see General Video Information)
  503.  
  504.     POPUP       display a pop-up window                           BV,  ,MV,
  505.                    DX <-- parameter pointer
  506.  
  507.     SHOWCURSOR  show the cursor                                   BV,  ,MV,
  508.  
  509.     STROUT      display a string                                  BV,DV,MV,CG
  510.                    DS:DX <-- pointer to ASCIIZ string
  511.  
  512.     WHERE       get the current cursor position                   BV,   MV,CG
  513.                    DH = row (1-25), DL = column (1-40/80)
  514.  
  515.                            String Services (ASCIIZ)
  516.  
  517.  
  518.  
  519. The ASCIIZ String Services provide a wide assortment of services for dealing
  520. with null-terminated strings.
  521.  
  522. Note that, although many of the string services are designed to place the
  523. result of processing a first string into a second string, it is not actually
  524. necessary to use two string buffers.  The services are designed so that you
  525. can place the results back into the original string buffer by using the same
  526. address for both strings.
  527.  
  528.  
  529. The following routines are included amongst the ASCIIZ String Services:
  530.  
  531.    S0_COMPARE    compares two strings
  532.                     DS:SI <-- first string
  533.                     ES:DI <-- second string
  534.                     Flags = ZF if equal, NZ if not equal
  535.                             CY if first < second, NC if first >= second
  536.  
  537.    S0_DUPE       forms a string by duplicating a character
  538.                     ES:DI <-- result string
  539.                        AL <-- character to duplicate
  540.                        CX <-- number of times to repeat the character
  541.  
  542.    S0_LEFT       copies a specified section from the left of a string
  543.                     DS:SI <-- source string
  544.                        CX <-- number of characters to copy
  545.                     ES:DI <-- result string
  546.  
  547.    S0_LENGTH     gets the length of a string (excluding the null terminator)
  548.                     DS:SI <-- string
  549.                        CX = string length
  550.  
  551.    S0_LOCASE     converts a string to lowercase (international)
  552.                     DS:SI <-- source string
  553.                     ES:DI <-- result string
  554.  
  555.    S0_MID        copies a specified section of a string
  556.                     DS:SI <-- source string
  557.                        DX <-- where to start copying from (1-xx)
  558.                        CX <-- how many characters to copy
  559.                     ES:DI <-- result string
  560.  
  561.    S0_RIGHT      copies a specified section from the right of a string
  562.                     DS:SI <-- source string
  563.                        CX <-- number of characters to copy
  564.                     ES:DI <-- result string
  565.  
  566.    S0_TRIM       trims the "white space" (blanks and control characters) from
  567.                  either side (or both sides) of a string
  568.                     DS:SI <-- source string
  569.                        AL <-- set bit 0 to trim the left, bit 1 for right
  570.                     ES:DI <-- result string
  571.  
  572.    S0_UPCASE     converts a string to uppercase (international)
  573.                     DS:SI <-- source string
  574.                     ES:DI <-- result string
  575.  
  576.                           Telecommunications Services
  577.  
  578.  
  579.  
  580. The Telecommunications Services provide functions that are useful for
  581. telecommunications.  This includes services for manipulating the serial port
  582. and services that aid in performing file transfers and similar functions.
  583.  
  584.  
  585. The following routines are included amongst the Telecommunications Services:
  586.  
  587.    TC_CHKSUM     calculate the Xmodem/Ymodem checksum of a block of data
  588.                     DS:SI <-- pointer to a data block
  589.                        CX <-- length of data block (in bytes)
  590.                     -------
  591.                        AX = checksum
  592.  
  593.    TC_CRC        calculate the Xmodem/Ymodem CRC of a block of data
  594.                     DS:SI <-- pointer to a data block
  595.                        CX <-- length of data block (in bytes)
  596.                     -------
  597.                        AX = resulting CRC
  598.  
  599.                             Time and Date Services
  600.  
  601.  
  602.  
  603. The Time and Date Services provide international date handling.  Based on the
  604. country code given it by DOS, these services return strings that represent
  605. the current time or date in the appropriate format for that country.
  606.  
  607. These services provide a simple way to make your software work properly on
  608. any computer anywhere, across the world.
  609.  
  610. See the COUNTRY entry under CONFIG.SYS in your DOS manual for more details.
  611. Note that DOS version 3.0 or greater is required to insure that the date and
  612. time delimiters are appropriate.  Otherwise, the date and time formats will
  613. still be correct, but the delimiters used will be assumed to be "-" for the
  614. date and ":" for the time.  With DOS versions before 3.0, the time will be
  615. presented in 12-hour (am/pm) format.
  616.  
  617.  
  618. The following routines are included amongst the Time and Date Services:
  619.  
  620.    TD_GETDATE    get the current date as an ASCIIZ string
  621.                  DS:DX <-- pointer to a buffer (minimum 11 bytes)
  622.                     AL <-- 0 for 2-digit year, 1 for 4-digit year
  623.  
  624.    TD_GETTIME    get the current date as an ASCIIZ string
  625.                  DS:DX <-- pointer to a buffer (minimum 8 bytes)
  626.